package com.example.ddanjifeedmaker;
import FeedMaker.FeedReader;
import FeedMaker.DropBoxHandler;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;

public class DdanjiFeedMaker extends Service
{
	private FeedReader feed_reader_;
	
	@Override
	public void onCreate()
	{
		super.onCreate();
	}
	
	@Override
	public void onStart(Intent intent, int startId)
	{
		//super.onStart(intent, startId);
		
		if( feed_reader_ == null )
		{			
			feed_reader_ = new FeedReader();
	        
	        feed_reader_.feeds_.add( "http://old.ddanzi.com/appstream/ddradio.xml", "" );
	        feed_reader_.feeds_.add( "http://old.ddanzi.com/appstream/ddanddara.xml", "" );
	        feed_reader_.feeds_.add( "http://old.ddanzi.com/appstream/ggobsari.xml", "" );
	        feed_reader_.feeds_.add( "http://old.ddanzi.com/appstream/drama.xml", "" );
	        
	        feed_reader_.start();
		}		
	}
	
	@Override
	public void onDestroy()
	{
		feed_reader_.interrupt();
		DropBoxHandler.close();
		super.onDestroy();
	}
	
	@Override
	public IBinder onBind(Intent intent)
	{
		return null;
	}
}
